package com.peng.design.visitor;

/**
 * SoldierUnit
 *
 * @author: lupeng10
 * @create: 2023-06-08 14:30
 */
public class SoldierUnit extends Unit implements HasName {

    private final String name;

    public SoldierUnit(String name, Unit... children) {
        super(children);
        this.name = name;
    }

    public void accept(UnitVisitor visitor) {
        visitor.visit(this);
        super.accept(visitor);
    }

    @Override
    public String getName() {
        return name;
    }
}
